﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Reflection;
using System.Text;

namespace UtilZ.Dotnet.Ex.Model
{
    /// <summary>
    /// 属性或字段或枚举成员信息
    /// </summary>
    public class PropertyFieldMemberInfo
    {
        /// <summary>
        /// 获取或设置显示名称
        /// </summary>
        public string DisplayName { get; private set; }

        /// <summary>
        /// 获取或设置描述
        /// </summary>
        public string Description { get; private set; }

        /// <summary>
        /// 获取或设置值
        /// </summary>
        public object Value { get; private set; }

        /// <summary>
        /// 数据标识
        /// </summary>
        public object Tag { get; private set; }

        /// <summary>
        /// 默认构造函数
        /// </summary>
        public PropertyFieldMemberInfo()
            : this(string.Empty, null, string.Empty, null)
        {
            
        }

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="displayName">显示文本</param>
        /// <param name="value">值</param>
        public PropertyFieldMemberInfo(string displayName, object value)
            : this(displayName, value, string.Empty, null)
        {

        }

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="displayName">显示文本</param>
        /// <param name="value">值</param>
        /// <param name="description">项描述</param>
        public PropertyFieldMemberInfo(string displayName, object value, string description)
            : this(displayName, value, description, null)
        {

        }

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="displayName">显示文本</param>
        /// <param name="value">值</param>
        /// <param name="description">项描述</param>
        /// <param name="tag">数据标识</param>
        public PropertyFieldMemberInfo(string displayName, object value, string description, object tag)
        {
            this.DisplayName = displayName;
            this.Value = value;
            this.Description = description;
            this.Tag = tag;
        }

        

        /// <summary>
        /// 重写ToString
        /// </summary>
        /// <returns>下拉框显示文本</returns>
        public override string ToString()
        {
            return this.DisplayName;
        }

    }
}
